<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<HTML>
<HEAD>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="${pageContext.request.contextPath}/css/Style1.css" rel="stylesheet"
          type="text/css"/>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css"
          type="text/css"/>
    <script src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"
            type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap-3.1.1.min.js"
            type="text/javascript"></script>


    <script type="text/javascript">

        function createXmlHttp() {
            var xmlHttp;
            try { // Firefox, Opera 8.0+, Safari
                xmlHttp = new XMLHttpRequest();
            }
            catch (e) {
                try {// Internet Explorer
                    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch (e) {
                    try {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch (e) {
                    }
                }
            }

            return xmlHttp;
        }
    </script>
</HEAD>
<body>
<br>
<form id="Form1" name="Form1" action="${pageContext.request.contextPath}/user/list.jsp"
      method="post">
    <table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
        <TBODY>
        <tr>
            <td class="ta_01" align="center" bgColor="#afd1f3">
                <strong>订单列表</strong>
            </TD>
        </tr>

        <tr>
            <td class="ta_01" align="center" bgColor="#f5fafe">
                <table cellspacing="0" cellpadding="1" rules="all"
                       bordercolor="gray" border="1" id="DataGrid1"
                       style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                    <tr
                            style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">

                        <td align="center" width="10%">
                            序号
                        </td>
                        <td align="center" width="10%">
                            订单编号
                        </td>
                        <td align="center" width="10%">
                            订单金额
                        </td>
                        <td align="center" width="10%">
                            收货人
                        </td>
                        <td align="center" width="10%">
                            订单状态
                        </td>
                        <td align="center" width="50%">
                            订单详情
                        </td>
                    </tr>
                    <c:forEach items="${page.list}" var="list" varStatus="o">
                        <tr onmouseover="this.style.backgroundColor = 'white'"
                            onmouseout="this.style.backgroundColor = '#F5FAFE';">
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="18%">
                                    ${o.count}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="17%">
                                    ${list.oid}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="17%">
                                    ${list.total}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="17%">
                                    ${list.name}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="17%">
                                <c:if test="${list.state == 0}">
                                    未付款
                                </c:if>
                                <c:if test="${list.state == 1}">
                                    <a href="${ pageContext.request.contextPath }/order/shipments.do?oid=${list.oid}"><font
                                            color="blue">发货</font></a>
                                </c:if>
                                <c:if test="${list.state == 2}">
                                    <a href="${ pageContext.request.contextPath }/order/expcheck.do?oid=${list.oid}"><font
                                            color="blue">已发货，可查看快递</font></a>
                                </c:if>
                                <c:if test="${list.state == 3}">
                                    用户已收货
                                </c:if>
                                <c:if test="${list.state ==4}">
                                    用户已退款
                                </c:if>

                            </td>
                            <td align="center" style="HEIGHT: 22px">
                                <div>
                                    <a class="button" href="${pageContext.request.contextPath}/admin/adminFindItem.do?oid=${list.oid}">订单详情</a>
                                </div>
                            </td>

                        </tr>
                    </c:forEach>
                </table>
            </td>
        </tr>

        <tr>
            <td>
                <div style="width:380px;margin:0 auto;margin-top:50px;">
                    <ul class="pagination" style="text-align:center; margin-top:10px;">
                        <c:if test="${page.navigateFirstPage <= page.navigateLastPage}">


                                <li>
                                    <a href="${pageContext.request.contextPath}/admin/adminFindAllOrder.do?page=${page.prePage}"
                                       aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
                                </li>

                            <c:forEach begin="${page.navigateFirstPage}"
                                       end="${page.navigateLastPage}" var="i">
                                <c:if test="${page.page != i}">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/adminFindAllOrder.do?page=${i}">${i}</a>
                                    </li>
                                </c:if>
                                <c:if test="${page.page == i}">
                                    <li class="active">
                                        <a href="${pageContext.request.contextPath}/admin/adminFindAllOrder.do?page=${i}">${i}</a>
                                    </li>
                                </c:if>
                            </c:forEach>

                                <li>
                                    <a href="${pageContext.request.contextPath}/admin/adminFindAllOrder.do?page=${page.nextPage}"
                                       aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                        </c:if>


                    </ul>
                </div>
            </td>
        </tr>
        </TBODY>
    </table>
</form>
</body>
</HTML>

